jQuery.validator.addMethod("phone",function(value, element){
	if($(element).attr("isNull")&&value == "") return true;
	var reg = /^(?:\(?[0\+]?\d{1,3}\)?)[\s-]?(?:0|\d{1,4})[\s-]?(?:(?:13\d{9})|(?:\d{7,8}))$/;
	return (reg.test(value.trim()));
},"请输入正确的手机号");
jQuery.validator.addMethod("email",function(value, element){
	if($(element).attr("isNull")&&value == "") return true;
	var reg = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/;
	return (reg.test(value.trim()));
},"请输入正确的邮箱");
jQuery.validator.addMethod("mobile",function(value, element){
	if($(element).attr("isNull")&&value == "") return true;
	var reg;
	if(value.indexOf("-") > -1 ){//电话
		reg = /^(?:\(?[0\+]\d{2,3}\)?)[\s-]?(?:(?:\(0{1,3}\))?[0\d]{1,4})[\s-](?:[\d]{7,8}|[\d]{3,4}[\s-][\d]{3,4})$/;
	}else{//手机
		reg = /^(\+?0?86\-?)?1[345789]\d{9}$/;
	}
	return (reg.test(value.trim()));postal
},"请输入正确的电话号码");
jQuery.validator.addMethod("postal",function(value, element){
	if($(element).attr("isNull")&&value == "") return true;
	console.log(value);
	var reg = /^([1-9][0-9]{5})$/;
	return (reg.test(value.trim()));
},"请输入正确的邮编编码");
jQuery.validator.addMethod("txfh",function(value, element) {
	if($(element).attr("isNull")&&value == "") return true;
	var regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im,
	regCn = /[·！#￥（——）：；“”‘、，|《。》？、【】[\]]/im;
    return !regEn.test(value.replace(/,/g,""))||!regCn.test(value.replace(/,/g,""));
},"不能输入特殊符号");
jQuery.validator.addMethod("selectsNotNull",function(value,element){
	return $("input[name = '" + $(element).attr("data-name") + "']").val()!="";
},"请选择");

jQuery.validator.addMethod("decimal",function(value, element) {
	if($(element).attr("isNull")&&value == "") return true;
    var a = /^[0-9]{1,10}([.][0-9]{1,6})?$/;
    return a.test(value.replace(/,/g,""));
},"格式错误！最大整数10位，小数6位");
jQuery.validator.addMethod("decimal3",function(value, element) {
	if($(element).attr("isNull")&&value == "") return true;
    var a = /^[0-9]{1,6}([.][0-9]{1,10})?$/;
    return a.test(value.replace(/,/g,""));
},"格式错误！最大整数6位，小数10位");

jQuery.validator.addMethod("decimal_3_2",function(value, element) {
	if($(element).attr("isNull")&&value == "") return true;
    var a = /(?!^0\.0?0$)^[0-9]{1,3}?(\.[0-9]{1,2})?$|^100$/;
    return a.test(value.replace(/,/g,""));
},"格式错误！最大整数3位，小数2位");

jQuery.validator.addMethod("decimal_2_3",function(value, element) {
    if($(element).attr("isNull")&&value == "") return true;
    var a = /(?!^0\.0?0$)^[0-9]{1,2}?(\.[0-9]{1,3})?$|^100$/;
    return a.test(value.replace(/,/g,""));
},"格式错误！最大整数2位，小数3位");

jQuery.validator.addMethod("decimal_2_1",function(value, element) {
    if($(element).attr("isNull")&&value == "") return true;
    var a = /(?!^0\.0?0$)^[0-9]{1,2}?(\.[0-9])?$|^100$/;
    return a.test(value.replace(/,/g,""));
},"格式错误！最大整数2位，小数1位");

jQuery.validator.addMethod("decimal_2_2",function(value, element) {
    if($(element).attr("isNull")&&value == "") return true;
    var a = /(?!^0\.0?0$)^[0-9]{1,2}?(\.[0-9]{1,2})?$|^100$/;
    return a.test(value.replace(/,/g,""));
},"格式错误！最大整数2位，小数2位");

jQuery.validator.addMethod("decimal_4_0",function(value, element) {
    if($(element).attr("isNull")&&value == "") return true;
    var a = /(?!^0\.0?0$)^[0-9]{1,4}$/;
    return a.test(value.replace(/,/g,""));
},"格式错误！最大整数4位，小数0位");

